class Rect {
  var width, height;
  Rect(this.width, this.height);
  // Rect(): width = 10, height = 10; // 构造函数调用之前初始化实例变量 (初始化列表)

  // 或者叫计算属性
  get area {
    return this.width * this.height;
  }

  set square(side) {
    this.width = side;
    this.height = side;
  }

  countArea() {
    print('area is ${this.area}');
  }
}
